﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Collections;

namespace Agresso.Interface.Layer.Domain
{
    public class acrbatchinput
    {
        public DateTime arrival_date = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public DateTime disc_date = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public DateTime due_date = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public DateTime trans_date = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public DateTime voucher_date = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public DateTime compl_delay = new DateTime(2000,1,1);//	 datetime	 NOT NULL,
        public decimal amount = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal base_amount = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal base_curr = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal cur_amount = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal discount = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal exch_rate = 0;//	 decimal	(28, 8) NOT NULL,
        public decimal exch_rate2 = 0;//	 decimal	(28, 8) NOT NULL,
        public decimal exch_rate3 = 0;//	 decimal	(28, 8) NOT NULL,
        public decimal value_1 = 0;//	 decimal	(28, 8) NOT NULL,
        public decimal value_2 = 0;//	 decimal	(28, 3) NOT NULL,
        public decimal value_3 = 0;//	 decimal	(28, 3) NOT NULL,
        public int arrive_id = 0;//	 bigint	 NOT NULL,
        public int order_id = 0;//	 bigint	 NOT NULL,
        public int pay_plan_id = 0;//	 bigint	 NOT NULL,
        public int remitt_id = 0;//	 bigint	 NOT NULL,
        public int voucher_no = 0;//	 bigint	 NOT NULL,
        public int voucher_ref = 0;//	 bigint	 NOT NULL,
        public int orig_reference = 0;//	 bigint	 NOT NULL,
        public int number_1 = 0;//	 int	 NOT NULL,
        public int period = 0;//	 int	 NOT NULL,
        public int sequence_no = 0;//	 int	 NOT NULL,
        public int sequence_ref = 0;//	 int	 NOT NULL,
        public int allocation_key = 0;//	 smallint	 NOT NULL,
        public int dc_flag = 0;//	 smallint	 NOT NULL,
        public int period_no = 0;//	 smallint	 NOT NULL,
        public int collection = 0;//	 tinyint	 NOT NULL,
        public int error_flag = 0;//	 tinyint	 NOT NULL,
        public int pay_flag = 0;//	 tinyint	 NOT NULL,
        public int tax_id = 0;//	 tinyint	 NOT NULL,
        public int agrtid  = 0; // [bigint] IDENTITY(1,1) NOT NULL,------------------------
        public string account = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string account2 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string address = string.Empty;//	 nvarchar	(160) NOT NULL,
        public string apar_id = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string apar_name = string.Empty;//	 nvarchar	(255) NOT NULL,
        public string apar_type = string.Empty;//	 nvarchar	(1) NOT NULL,
        public string ba_country_code = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string bank_acc_type = string.Empty;//	 nvarchar	(2) NOT NULL,
        public string bank_account = string.Empty;//	 nvarchar	(35) NOT NULL,
        public string batch_id = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string clearing_code = string.Empty;//	 nvarchar	(13) NOT NULL,
        public string client = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string client_ref = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string commitment = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string complaint = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string contract_id = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string country_code = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string curr_doc = string.Empty;//	 nvarchar	(20) NOT NULL,
        public string curr_licence = string.Empty;//	 nvarchar	(3) NOT NULL,
        public string currency = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string description = string.Empty;//	 nvarchar	(255) NOT NULL,
        public string dim_1 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_2 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_3 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_4 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_5 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_6 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string dim_7 = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string ext_inv_ref = string.Empty;//	 nvarchar	(100) NOT NULL,
        public string ext_ref = string.Empty;//	 nvarchar	(255) NOT NULL,
        public string factor_short = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string foreign_bank = string.Empty;//	 nvarchar	(255) NOT NULL,
        public string interface_ = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string intrule_id = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string kid = string.Empty;//	 nvarchar	(27) NOT NULL,
        public string pay_currency = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string pay_method = string.Empty;//	 nvarchar	(2) NOT NULL,
        public string pay_temp_id = string.Empty;//	 nvarchar	(4) NOT NULL,
        public string pay_transfer = string.Empty;//	 nvarchar	(2) NOT NULL,
        public string place = string.Empty;//	 nvarchar	(40) NOT NULL,
        public string province = string.Empty;//	 nvarchar	(40) NOT NULL,
        public string rem_level = string.Empty;//	 nvarchar	(1) NOT NULL,
        public string responsible = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string status = string.Empty;//	 nvarchar	(1) NOT NULL,
        public string swift = string.Empty;//	 nvarchar	(11) NOT NULL,
        public string tax_code = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string tax_system = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string trans_type = string.Empty;//	 nvarchar	(2) NOT NULL,
        public string vat_reg_no = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string voucher_type = string.Empty;//	 nvarchar	(25) NOT NULL,
        public string zip_code = string.Empty;//	 nvarchar	(15) NOT NULL,
        public string ext_arch_ref = string.Empty;//	 nvarchar	(50) NOT NULL,

        public object Tag;
        public IList acrList = new ArrayList(); // CREW PAYROLL

         public acrbatchinput() { }
         public acrbatchinput(SqlDataReader rd)
         {
             arrival_date = Convert.ToDateTime(rd["arrival_date"]);
             disc_date = Convert.ToDateTime(rd["disc_date"]);
             due_date = Convert.ToDateTime(rd["due_date"]);
             trans_date = Convert.ToDateTime(rd["trans_date"]);
             voucher_date = Convert.ToDateTime(rd["voucher_date"]);
             compl_delay = Convert.ToDateTime(rd["compl_delay"]);
             amount = Convert.ToDecimal(rd["amount"]);
             base_amount = Convert.ToDecimal(rd["base_amount"]);
             base_curr = Convert.ToDecimal(rd["base_curr"]);
             cur_amount = Convert.ToDecimal(rd["cur_amount"]);
             discount = Convert.ToDecimal(rd["discount"]);
             exch_rate = Convert.ToDecimal(rd["exch_rate"]);
             exch_rate2 = Convert.ToDecimal(rd["exch_rate2"]);
             exch_rate3 = Convert.ToDecimal(rd["exch_rate3"]);
             value_1 = Convert.ToDecimal(rd["value_1"]);
             value_2 = Convert.ToDecimal(rd["value_2"]);
             value_3 = Convert.ToDecimal(rd["value_3"]);
             arrive_id = Convert.ToInt32(rd["arrive_id"]);
             order_id = Convert.ToInt32(rd["order_id"]);
             pay_plan_id = Convert.ToInt32(rd["pay_plan_id"]);
             remitt_id = Convert.ToInt32(rd["remitt_id"]);
             voucher_no = Convert.ToInt32(rd["voucher_no"]);
             voucher_ref = Convert.ToInt32(rd["voucher_ref"]);
             orig_reference = Convert.ToInt32(rd["orig_reference"]);
             number_1 = Convert.ToInt32(rd["number_1"]);
             period = Convert.ToInt32(rd["period"]);
             sequence_no = Convert.ToInt32(rd["sequence_no"]);
             sequence_ref = Convert.ToInt32(rd["sequence_ref"]);
             allocation_key = Convert.ToInt32(rd["allocation_key"]);
             dc_flag = Convert.ToInt32(rd["dc_flag"]);
             period_no = Convert.ToInt32(rd["period_no"]);
             collection = Convert.ToInt32(rd["collection"]);
             error_flag = Convert.ToInt32(rd["error_flag"]);
             pay_flag = Convert.ToInt32(rd["pay_flag"]);
             tax_id = Convert.ToInt32(rd["tax_id"]);
             agrtid = Convert.ToInt32(rd["agrtid"]);
             account = rd["account"].ToString();
             account2 = rd["account2"].ToString();
             address = rd["address"].ToString();
             apar_id = rd["apar_id"].ToString();
             apar_name = rd["apar_name"].ToString();
             apar_type = rd["apar_type"].ToString();
             ba_country_code = rd["ba_country_code"].ToString();
             bank_acc_type = rd["bank_acc_type"].ToString();
             bank_account = rd["bank_account"].ToString();
             batch_id = rd["batch_id"].ToString();
             clearing_code = rd["clearing_code"].ToString();
             client = rd["client"].ToString();
             client_ref = rd["client_ref"].ToString();
             commitment = rd["commitment"].ToString();
             complaint = rd["complaint"].ToString();
             contract_id = rd["contract_id"].ToString();
             country_code = rd["country_code"].ToString();
             curr_doc = rd["curr_doc"].ToString();
             curr_licence = rd["curr_licence"].ToString();
             currency = rd["currency"].ToString();
             description = rd["description"].ToString();
             dim_1 = rd["dim_1"].ToString();
             dim_2 = rd["dim_2"].ToString();
             dim_3 = rd["dim_3"].ToString();
             dim_4 = rd["dim_4"].ToString();
             dim_5 = rd["dim_5"].ToString();
             dim_6 = rd["dim_6"].ToString();
             dim_7 = rd["dim_7"].ToString();
             ext_inv_ref = rd["ext_inv_ref"].ToString();
             ext_ref = rd["ext_ref"].ToString();
             factor_short = rd["factor_short"].ToString();
             foreign_bank = rd["foreign_bank"].ToString();
             interface_ = rd["interface"].ToString();
             intrule_id = rd["intrule_id"].ToString();
             kid = rd["kid"].ToString();
             pay_currency = rd["pay_currency"].ToString();
             pay_method = rd["pay_method"].ToString();
             pay_temp_id = rd["pay_temp_id"].ToString();
             pay_transfer = rd["pay_transfer"].ToString();
             place = rd["place"].ToString();
             province = rd["province"].ToString();
             rem_level = rd["rem_level"].ToString();
             responsible = rd["responsible"].ToString();
             status = rd["status"].ToString();
             swift = rd["swift"].ToString();
             tax_code = rd["tax_code"].ToString();
             tax_system = rd["tax_system"].ToString();
             trans_type = rd["trans_type"].ToString();
             vat_reg_no = rd["vat_reg_no"].ToString();
             voucher_type = rd["voucher_type"].ToString();
             zip_code = rd["zip_code"].ToString();
             ext_arch_ref = rd["ext_arch_ref"].ToString();
         }
         public acrbatchinput Duplicate()
         {
             acrbatchinput result = new acrbatchinput();
             result.arrival_date = this.arrival_date;
             result.disc_date = this.disc_date;
             result.due_date = this.due_date;
             result.trans_date = this.trans_date;
             result.voucher_date = this.voucher_date;
             result.compl_delay = this.compl_delay;
             result.amount = this.amount;
             result.base_amount = this.base_amount;
             result.base_curr = this.base_curr;
             result.cur_amount = this.cur_amount;
             result.discount = this.discount;
             result.exch_rate = this.exch_rate;
             result.exch_rate2 = this.exch_rate2;
             result.exch_rate3 = this.exch_rate3;
             result.value_1 = this.value_1;
             result.value_2 = this.value_2;
             result.value_3 = this.value_3;
             result.arrive_id = this.arrive_id;
             result.order_id = this.order_id;
             result.pay_plan_id = this.pay_plan_id;
             result.remitt_id = this.remitt_id;
             result.voucher_no = this.voucher_no;
             result.voucher_ref = this.voucher_ref;
             result.orig_reference = this.orig_reference;
             result.number_1 = this.number_1;
             result.period = this.period;
             result.sequence_no = this.sequence_no;
             result.sequence_ref = this.sequence_ref;
             result.allocation_key = this.allocation_key;
             result.dc_flag = this.dc_flag;
             result.period_no = this.period_no;
             result.collection = this.collection;
             result.error_flag = this.error_flag;
             result.pay_flag = this.pay_flag;
             result.tax_id = this.tax_id;
             result.agrtid = this.agrtid;
             result.account = this.account;
             result.account2 = this.account2;
             result.address = this.address;
             result.apar_id = this.apar_id;
             result.apar_name = this.apar_name;
             result.apar_type = this.apar_type;
             result.ba_country_code = this.ba_country_code;
             result.bank_acc_type = this.bank_acc_type;
             result.bank_account = this.bank_account;
             result.batch_id = this.batch_id;
             result.clearing_code = this.clearing_code;
             result.client = this.client;
             result.client_ref = this.client_ref;
             result.commitment = this.commitment;
             result.complaint = this.complaint;
             result.contract_id = this.contract_id;
             result.country_code = this.country_code;
             result.curr_doc = this.curr_doc;
             result.curr_licence = this.curr_licence;
             result.currency = this.currency;
             result.description = this.description;
             result.dim_1 = this.dim_1;
             result.dim_2 = this.dim_2;
             result.dim_3 = this.dim_3;
             result.dim_4 = this.dim_4;
             result.dim_5 = this.dim_5;
             result.dim_6 = this.dim_6;
             result.dim_7 = this.dim_7;
             result.ext_inv_ref = this.ext_inv_ref;
             result.ext_ref = this.ext_ref;
             result.factor_short = this.factor_short;
             result.foreign_bank = this.foreign_bank;
             result.interface_ = this.interface_;
             result.intrule_id = this.intrule_id;
             result.kid = this.kid;
             result.pay_currency = this.pay_currency;
             result.pay_method = this.pay_method;
             result.pay_temp_id = this.pay_temp_id;
             result.pay_transfer = this.pay_transfer;
             result.place = this.place;
             result.province = this.province;
             result.rem_level = this.rem_level;
             result.responsible = this.responsible;
             result.status = this.status;
             result.swift = this.swift;
             result.tax_code = this.tax_code;
             result.tax_system = this.tax_system;
             result.trans_type = this.trans_type;
             result.vat_reg_no = this.vat_reg_no;
             result.voucher_type = this.voucher_type;
             result.zip_code = this.zip_code;
             result.ext_arch_ref = this.ext_arch_ref;
             return result;
         }
        /// <summary>
         /// CREW PAYROLL--------//should check transaction type if other type            
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
         public override bool Equals(object obj)
         {
             if (!(obj is acrbatchinput)) return false;
             acrbatchinput eq = (acrbatchinput)obj;
             bool a = eq.client.Trim() == client.Trim();
             bool b = eq.account.Trim() == account.Trim();
             bool c = eq.dim_5.Trim() == dim_5.Trim();
             bool d = eq.dim_6.Trim() == dim_6.Trim();
             return a && b && c && d;
         }
        
    }
}
